From 2b1269fee44186f5778007e66f63edafd45eb645 Mon Sep 17 00:00:00 2001 From: Vicente Bertolotti Date: Fri, 24 Apr 2026 21:26:28 -0400 Subject: [PATCH] animation: Prevent spinner animation from resetting Currently, the search status spinner animation restarts on every single keystroke while a search is in progress. This occurs because redundant calls to `play()` replace the previous content and restart the animation from the beginning. This commit fixes this by ignoring redundant `play()` and `stop()` calls. Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8695 Part-of: --- js/ui/animation.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/ui/animation.js b/js/ui/animation.js index 882241cb1..a76bc3a9a 100644 --- a/js/ui/animation.js +++ b/js/ui/animation.js @@ -32,6 +32,8 @@ class Spinner extends St.Widget { } play() { + if (this._playing) + return; this.remove_all_transitions(); this.set_content(new St.SpinnerContent()); this.show(); @@ -49,6 +51,8 @@ class Spinner extends St.Widget { } stop() { + if (!this._playing) + return; this.remove_all_transitions(); if (this._animate) { @@ -70,4 +74,8 @@ class Spinner extends St.Widget { this.hide(); } } + + get _playing() { + return this.visible && this.content !== null; + } }); -- 2.39.5